<template>
	<view class="page ex-mall-tab-page" :class="[$themeClass('panel-content-bg-color')]">
		<view class="header-fill">
			<!-- #ifdef MP-WEIXIN -->
			<view class="ex-mall-header-mp-weixin-fill">发布</view>
			<!-- #endif -->
		</view>
		<view class="container">
			<view class="ex-mall-panel-title" :class="[$themeClass('panel-another-title-bg-color'), $themeClass('panel-another-title-color')]">
				<view class="title">分类</view>
			</view>
			<view class="ex-mall-panel classify">
				<!-- <view class="ex-mall-panel-title" :class="[$themeClass('panel-another-title-bg-color'), $themeClass('panel-another-title-color')]">
					<view class="text">分类</view>
				</view> -->
				<view class="ex-mall-panel-content" :class="[$themeClass('panel-another-content-bg-color')]">
					<view class="list">
						<view class="item" :class="{'item-thumbnail': x.thumbnail}" v-for="(x, xi) in classifies" :key="xi">
							<view class="thumbnail" v-if="x.thumbnail">
								<image class="img"></image>
							</view>
							<text class="text">{{x.name}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				classifies: [{
					thumbnail: 'a',
					name: '数码'
				}, {
					thumbnail: 'b',
					name: '配饰'
				}, {
					thumbnail: 'c',
					name: '鞋类'
				}, {
					thumbnail: 'd',
					name: '家具'
				}, {
					name: '生活'
				}, {
					name: '服饰'
				}, {
					name: '家居'
				}, {
					name: '背包'
				}]
			}
		},
		mounted() {
			this.load()
			this.$emit('loaded', {
				name: 'search'
			})
		},
		methods: {
			load() {
				console.log('search on load')
			},
			show() {
				console.log('search on show')
			},
			hide() {
				console.log('search on hide')
			},
			search() {
				
			}
		}
	}
</script>

<style lang="scss">
	
	.page {
		&>.header-fill {
			padding: 0 28px;
			padding-top: calc(16px + var(--status-bar-height));
			background-color: #FFFFFF;
			
			&>.ex-mall-header-mp-weixin-fill {
				color: #3D3D3D;
			}
		}
	
		&>.container {
			/* #ifndef MP-WEIXIN */
			height: calc(100vh - 78px - 114px - 16px - var(--status-bar-height));
			/* #endif */
			/* #ifdef MP-WEIXIN */
			height: calc(100vh - 78px - 114px - 16px - var(--status-bar-height) - 50px);
			/* #endif */
			background-color: #FFFFFF;
			border-radius: 0 0 2em 2em;
			overflow-y: scroll;
	
			&>.header {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 12px 28px 28px 28px;
				background-color: #FFFFFF;
	
				&>.title {
					font-size: 18px;
					font-weight: 600;
				}
	
				&>.btns {
					display: flex;
	
					&>.btn {
						margin-left: 16px;
					}
				}
			}
	
			&>.content.list {
				padding-top: 10px;
	
				&>.item {
					display: flex;
					justify-content: space-between;
					padding: 0 28px 28px 28px;
	
					&:nth-child(4n-3) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #0EAA90;
								}
							}
						}
					}
	
					&:nth-child(4n-2) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #F8E3DC;
								}
							}
						}
					}
	
					&:nth-child(4n-1) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #A8A8A9;
								}
							}
						}
					}
	
					&:nth-child(4n) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #7F8688;
								}
							}
						}
					}
	
					&>.left {
						display: flex;
						align-items: center;
						flex: 1;
	
						&>.checkbox {
							&>.icon {
								font-size: 20px;
								color: #9093A2;
							}
						}
	
						&>.thumbnail {
							margin-left: 12px;
	
							&>.img {
								display: block;
								width: 88px;
								height: 88px;
								border-radius: 12px;
							}
						}
	
						&>.info {
							margin: 0 18px;
							line-height: 1;
	
							&>.title {
								line-height: 1.3;
								font-size: 15px;
								font-weight: 600;
	
								&>.spec {
									margin-left: 0.5em;
									color: #808080;
								}
							}
	
							&>.price {
								margin-top: 10px;
								font-size: 13px;
							}
						}
					}
	
					&>.right {
						height: 88px;
						background-color: #F7F7F7;
						border-radius: 12px;
						overflow: hidden;
	
						&>.numberbox {
							display: flex;
							flex-direction: column;
	
							&>.icon {
								display: flex;
								justify-content: center;
								align-items: center;
								width: 48px;
								height: 35px;
								font-size: 18px;
								font-weight: bold;
	
								&.plus {
									color: #61DAD5;
								}
	
								&.minus {
									color: #9093A2;
								}
							}
	
							&>.input {
								display: flex;
								justify-content: center;
								align-items: center;
								width: 48px;
								height: 18px;
								padding: 0 4px;
								text-align: center;
								font-size: 13px;
								color: #666666;
								box-sizing: border-box;
							}
						}
					}
				}
			}
		}
	
		&>.footer {
			padding: 28px;
	
			.btn {
				display: flex;
				justify-content: space-between;
				align-items: center;
				width: 100%;
				height: 58px;
				padding: 0 28px;
				border-radius: 12px;
				box-sizing: border-box;
			}
	
			&>.submit {
				&>.label {
					font-size: 15px;
					font-weight: 600;
				}
	
				&>.amount {
					font-size: 14px;
				}
			}
	
			&>.remove {
				&>.btn {
					justify-content: center;
				}
			}
		}
	}
	.ex-mall-panel.classify {
		.ex-mall-panel-content {
			padding-bottom: 24px;

			&>.list {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				padding: 0 28px;

				&>.item {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 41vw;
					height: 58px;
					margin-top: 10px;
					background-color: #FFFFFF;
					border: 2px solid #9093A2;
					border-radius: 12px;
					overflow: hidden;
					box-sizing: border-box;

					&:nth-child(1),
					&:nth-child(2) {
						margin-top: 0;
					}

					&>.text {
						font-size: 15px;
						font-weight: 600;
					}
				}

				&>.item-thumbnail {
					position: relative;
					height: 41vw;
					border: none;

					&>.thumbnail {
						width: 100%;
						height: 100%;

						&:before {
							content: "";
							position: absolute;
							top: 0;
							right: 0;
							bottom: 0;
							left: 0;
							z-index: 10;
							display: block;
							background-color: rgba(0, 0, 0, 0.1);
						}

						&>.img {
							width: 100%;
							height: 100%;
						}
					}

					&>.text {
						position: absolute;
						color: #FFFFFF;
					}

					&:nth-child(4n-3) {
						&>.thumbnail {
							&>.img {
								background-color: #98847D;
							}
						}
					}

					&:nth-child(4n-2) {
						&>.thumbnail {
							&>.img {
								background-color: #A06441;
							}
						}
					}

					&:nth-child(4n-1) {
						&>.thumbnail {
							&>.img {
								background-color: #645E66;
							}
						}
					}

					&:nth-child(4n) {
						&>.thumbnail {
							&>.img {
								background-color: #AA8B43;
							}
						}
					}
				}
			}
		}
	}
</style>
